﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Common/Site.Master" AutoEventWireup="true" CodeBehind="UserInformation.aspx.cs" Inherits="FortuneHeaven.Web.Pages.UserCenter.UserInformation" %>
<%@ Register Src="~/Controls/UserInforHead.ascx" TagPrefix="uc" TagName="UserInforHead" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<script src="../../Content/Script/IDCardCheck.js"></script>
<link type="text/css" rel="stylesheet" href="../../Content/CSS/person.css" />
<script type="text/javascript">
    var china = [
    //直辖市
 ['北京市', '东城区', '西城区', '朝阳区', '丰台区', '石景山区', '海淀区', '门头沟区', '房山区', '通州区', '顺义区', '昌平区', '大兴区', '怀柔区', '平谷区', '密云县', '延庆县'],
 ['上海市', '黄浦区', '卢湾区', '徐汇区', '长宁区', '静安区', '普陀区', '闸北区', '虹口区', '杨浦区', '闵行区', '宝山区', '嘉定区', '浦东新区', '金山区', '松江区', '青浦区', '奉贤区', '崇明县'],
 ['天津市', '和平区', '河东区', '河西区', '南开区', '河北区', '红桥区', '东丽区', '西青区', '津南区', '北辰区', '武清区', '宝坻区', '滨海新区', '宁河县', '静海县', '蓟县'],
 ['重庆市', '万州区', '涪陵区', '渝中区', '大渡口区', '江北区', '沙坪坝区', '九龙坡区', '南岸区', '北碚区', '万盛区', '双桥区', '渝北区', '巴南区', '黔江区', '长寿区', '江津区', '合川区', '永川区', '南川区', '綦江县', '潼南县', '铜梁县', '大足县', '荣昌县', '璧山县', '梁平县', '城口县', '丰都县', '垫江县', '武隆县', '忠县', '开县', '云阳县', '奉节县', '巫山县', '巫溪县', '石柱土家族自治县', '秀山土家族苗族自治县', '酉阳土家族苗族自治县', '彭水苗族土家族自治县'],
    //华北地区
 ['河北省', '石家庄', '唐山', '秦皇岛', '邯郸', '邢台', '保定', '张家口', '承德', '沧州', '廊坊', '衡水'],
 ['山西省', '太原', '大同', '阳泉', '长治', '晋城', '朔州', '晋中', '运城', '忻州', '临汾', '吕梁'],
 ['内蒙古自治区', '呼和浩特', '包头', '乌海', '赤峰', '通辽', '鄂尔多斯', '呼伦贝尔', '巴彦淖尔', '乌兰察布', '兴安', '锡林郭勒', '阿拉善'],
    //东北地区
 ['辽宁省', '沈阳', '大连', '鞍山', '抚顺', '本溪', '丹东', '锦州', '营口', '阜新', '辽阳', '盘锦', '铁岭', '朝阳', '葫芦岛'],
 ['吉林省', '长春', '吉林', '四平', '辽源', '通化', '白山', '松原', '白城', '延边'],
 ['黑龙江', '哈尔滨', '齐齐哈尔', '鸡西', '鹤岗', '双鸭山', '大庆', '伊春', '佳木斯', '七台河', '牡丹江', '黑河', '绥化', '大兴安岭'],
    //华东地区
 ['江苏省', '南京', '无锡', '徐州', '常州', '苏州', '南通', '连云港', '淮安', '盐城', '扬州', '镇江', '泰州', '宿迁'],
 ['浙江省', '杭州', '宁波', '温州', '嘉兴', '湖州', '绍兴', '金华', '衢州', '舟山', '台州', '丽水'],
 ['安徽省', '合肥', '芜湖', '蚌埠', '淮南', '马鞍山', '淮北', '铜陵', '安庆', '黄山', '滁州', '阜阳', '宿州', '巢湖', '六安', '亳州', '池州', '宣城'],
 ['福建省', '福州', '厦门', '莆田', '三明', '泉州', '漳州', '南平', '龙岩', '宁德'],
 ['江西省', '南昌', '景德镇', '萍乡', '九江', '新余', '鹰潭', '赣州', '吉安', '宜春', '抚州', '上饶'],
 ['山东省', '济南', '青岛', '淄博', '枣庄', '东营', '烟台', '潍坊', '威海', '济宁', '泰安', '日照', '莱芜', '临沂', '德州', '聊城', '滨州', '菏泽'],
    //中南地区
 ['河南省', '郑州', '开封', '洛阳', '平顶山', '焦作', '鹤壁', '新乡', '安阳', '濮阳', '许昌', '漯河', '三门峡', '南阳', '商丘', '信阳', '周口', '驻马店'],
 ['湖北省', '武汉', '黄石', '襄樊', '十堰', '荆州', '宜昌', '荆门', '鄂州', '孝感', '咸宁', '随州', '恩施'],
 ['湖南省', '长沙', '株洲', '湘潭', '衡阳', '邵阳', '岳阳', '常德', '张家界', '益阳', '郴州', '永州', '怀化', '娄底', '湘西'],
 ['广东省', '广州', '深圳', '珠海', '汕头', '韶关', '佛山', '江门', '湛江', '茂名', '肇庆', '惠州', '梅州', '汕尾', '河源', '阳江', '清远', '东莞', '中山', '潮州', '揭阳', '云浮'],
 ['广西自治区', '南宁', '柳州', '桂林', '梧州', '北海', '防城港', '钦州', '贵港', '玉林', '百色', '贺州', '河池', '来宾', '崇左'],
 ['海南省', '海口', '三亚'],
    //西南地区
 ['四川省', '成都', '自贡', '攀枝花', '泸州', '德阳', '绵阳', '广元', '遂宁', '内江', '乐山', '南充', '宜宾', '广安', '达州', '眉山', '雅安', '巴中', '资阳', "阿坝", "甘孜", "凉山"],
 ['贵州省', '贵阳', "六盘水", "遵义", "安顺", "铜仁", "毕节", "黔西南", "黔东南", "黔南"],
 ['云南省', '昆明', '曲靖', '玉溪', "保山", "昭通", "丽江", "普洱", "临沧", "文山", "红河", "西双版纳", "楚雄", "大理", "德宏", "怒江", "迪庆"],
 ['西藏自治区', "拉萨", "昌都", "山南", "日喀则", "那曲", "阿里", "林芝"],
    //西北地区
 ['陕西省', '西安', '铜川', '宝鸡', '咸阳', '渭南', '延安', '汉中', '榆林', '安康', '商洛'],
 ['甘肃省', "兰州", "嘉峪关", "金昌", "白银", "天水", "武威", "张掖", "平凉", "酒泉", "庆阳", "定西", "陇南", "临夏", "甘南"],
 ['青海省', "西宁", "海东", "海北", "黄南", "海南", "果洛", "玉树", "海西"],
 ['宁夏自治区', '银川', "石嘴山", "吴忠", "固原", "中卫"],
 ['新疆自治区', '乌鲁木齐', "克拉玛依", "吐鲁番", "哈密", "和田", "阿克苏", "喀什", "克孜勒苏柯尔克孜", "巴音郭楞蒙古", "昌吉", "博尔塔拉蒙古", "伊犁哈萨克", "塔城", "阿勒泰"],
    //港澳台
 ['香港特别行政区'],
 ['澳门特别行政区'],
 ['台湾省', "台北", "高雄", "基隆", "台中", "台南", "新竹", "嘉义"]
 ];

    function BindProvince(province, city) {
        var ProvinceCount = china.length;
        var ddlProvince = document.getElementById("ddlProvince");
        ddlProvince.innerHTML = "";

        for (var i = 0; i < ProvinceCount; i++) {
            ddlProvince.options[i] = new Option(china[i][0], china[i][0]);
        }
        ddlProvince.value = province;
        selectMoreCity(city);
    }



    function selectMoreCity(target) {

        var sbj = document.getElementById("ddlProvince");
        var selectProvince = sbj.options[sbj.selectedIndex].value;
        var ddlCity = document.getElementById("ddlCity");
        var ProvinceCount = china.length;
        for (var i = 0; i < ProvinceCount; i++) {
            if (china[i][0] == selectProvince) {
                var cityCount = china[i].length - 1;

                ddlCity.innerHTML = "";
                //ddlCity.options[0] = new Option(opt0,"");
                if (cityCount == 0) {
                    ddlCity.options[0] = new Option(china[i][0], china[i][0]);
                    break;
                }
                for (var j = 0; j < cityCount; j++) {

                    ddlCity.options[j] = new Option(china[i][j + 1], china[i][j + 1]);
                }
                break;
            }
        }
        if (target && target != '') {
            ddlCity.value = target;
        }
    }

    function init() {
        var myyear = document.getElementById("myyear");
        var mymonth = document.getElementById("mymonth");
        initDrop(myyear, 1955, 2012);
        initDrop(mymonth, 1, 12);

        getNowDate();
    }

    function initDate(year, month, day) {
        var myyear = document.getElementById("myyear");
        var mymonth = document.getElementById("mymonth");
        var myday = document.getElementById("myday");
        initDrop(myyear, 1955, 2012);
        initDrop(mymonth, 1, 12);

        myyear.value = year;
        mymonth.value = month;
        updateDay(year, month);
        myday.value = day;
    }
   

    function getNowDate() {
        var now = new Date();

        var nowYear = now.getFullYear();
        var nowMonth = now.getMonth() + 1;
        var nowDay = now.getDate();
        var myyear = document.getElementById("myyear");
        var mymonth = document.getElementById("mymonth");
        var myday = document.getElementById("myday");
        myyear.value = nowYear;
        mymonth.value = nowMonth;

        updateDay(nowYear, nowMonth);

        myday.value = nowDay;
    }

    //初始化下拉框
    function initDrop(drp, numStart, numEnd) {
        drp.length = 0;
        for (var i = numStart; i <= numEnd; i++) {
            drp.length++;
            drp.options[drp.length - 1].text = i;
            drp.options[drp.length - 1].value = i;
        }
    }

    //检测是否是闰年
    function checkLeapYear(year) {
        if ((year % 100 == 0) && (year % 400 == 0)) {
            return true;
        }
        else if (year % 4 == 0) {
            return true;
        }
        else {
            return false;
        }
    }
    function updateDayBaseSelect() {
        var myyear = document.getElementById("myyear");
        var mymonth = document.getElementById("mymonth");
        updateDay(myyear.value, mymonth.value);
    }

    //根据年月更新日期
    function updateDay(year, month) {
        var myday = document.getElementById("myday");
        var currentDay = myday.value;

        var daycount;
        if ((month == 4) || (month == 6) || (month == 9) || (month == 11)) {
            daycount = 30;
        }
        else if ((month == 2) && (checkLeapYear(year))) {
            daycount = 29;
        }
        else if (month == 2) {
            daycount = 28;
        }
        else {
            daycount = 31;
        }
        initDrop(myday, 1, daycount);

        //更新日期为当前的日期
        if (currentDay <= daycount)
            myday.value = currentDay;
        else
            myday.value = daycount;
    }
   
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div id="main">
        <div class="top">
            <span class="left">个人中心</span><span class="right">欢迎您，<asp:Literal id="ltName" runat="server"></asp:Literal></span></div>
        <div class="body">
            <uc:UserInforHead id="ucInforHead"  runat="server"></uc:UserInforHead>
            <div class="framlist">
                <span class="left">登录帐号：</span><span runat="server" id="spName" class="right"></span> </div>
            <div class="framlist">
                <span class="left">昵称：</span><span class="right"><asp:TextBox ID="txtNickName" runat="server" CssClass="text"></asp:TextBox></span></div>
            <div class="framlist">
                <span class="left">真实姓名：</span><span class="right"><asp:TextBox ID="txtRealName" runat="server" CssClass="text"></asp:TextBox></span></div>
           
            <div class="framlist">
                <span class="left">性别：</span><span class="right"> 
                     <input id="Gender_1" type="radio" value="1" name="Gender" />
                     <label for="Gender_1">男</label>
                     <input id="Gender_2" type="radio" value="2" name="Gender" />
                     <label for="Gender_2">女</label>
                    </span></div>
            <div class="framlist">
                <span class="left">生日：</span><span class="right">
                <select id="myyear" name="myyear" onchange="updateDayBaseSelect()">
                </select>年
                <select id="mymonth" name="mymonth" onchange="updateDayBaseSelect()">
                </select>月
                <select id="myday"  name="myday">
                </select>日
                </span></div>
             <div class="framlist">
                <span class="left">头像：</span><span class="right">
                    <img width="32" height="32" name="in_FaceID" id="in_FaceID" src="/GameFace/face<%=FaceID %>.bmp" />
			        <select  name="in_FaceID" size="1" onChange="document.getElementById('in_FaceID').src='/GameFace/face'+this.value+'.bmp';" class="input" ID="Select3">
			     <% for (int index = 0; index < 247; index++)
                { %>           
			        <option value="<%=index%>" <%= FaceID==index.ToString()?"selected":"" %>>头像<%= index+1%></option>
                <% } %>
			  </select>
                </span></div>
            <div class="framlist">
                <span class="left">联系邮箱：</span><span class="right"><asp:TextBox ID="txtMail" runat="server" CssClass="text"></asp:TextBox></span></div>
            <div class="framlist">
                <span class="left">手机：</span><span class="right"><asp:TextBox number ID="txtMobile" runat="server" CssClass="text"></asp:TextBox></span></div>
            <div class="framlist">
                <span class="left">QQ：</span><span class="right"><asp:TextBox number ID="txtQQ" runat="server" CssClass="text"></asp:TextBox></span></div>
            <div class="framlist">
                <span class="left">MSN：</span><span class="right"><asp:TextBox ID="txtMSN" runat="server" CssClass="text"></asp:TextBox></span></div>
            <div class="framlist">
                <span class="left"></span><span class="right">以下信息可作为客服取回账号的依据</span></div>
            <div class="framlist">
                <span class="left">证件类型：</span><span class="right">身份证</span></div>
            <div class="framlist">
                <span class="left">证件号码：</span><span class="right" runat="server" id="spIDCard" ></span></div>
            <div class="framlist">
                <span class="left"></span><span class="right"><asp:LinkButton ID="btnSave" runat="server" OnClick="SaveInfor" CssClass="onelink" OnClientClick="">保存</asp:LinkButton> <a class="twolink" href="<%= Page.ResolveUrl("~/Default.aspx")%>">返回</a></span></div>
        </div>
    </div>
<script type="text/javascript" language ="javascript">

    //BindProvince('<%= Province%>', "<%= City%>"); //只初始化省份
    initDate('<%= Year%>', "<%= Month%>", "<%= Day%>");
    $("input[name='Gender'][value=" + '<%= Gender%>' + "]").attr("checked", true);  
//    function CheckCard() {
//        var c = checktheform($(".testeryi").val(), $("#ddlProvince").val());
//        if(!c)
//            $("#result").html(errorinfor);
//        else
//            $("#result").html("Successs ");
//    }
</script>
</asp:Content>
